<?php

function is($field, $produk) 
{
    $CI = &get_instance();

    $get = $CI->input->get();

    $flag = false;
    foreach ($get as $key => $value) 
    {
        if(preg_match("#(src_fld|src_val)#i", $key)) 
        {
            $number = substr($key, -1, 1);
            if ($value == $field) 
            {
                $val1 = $get["src_val_start" . $number];
                $val2 = $get["src_val_end" . $number];
                
                if ($val1 != "" && $produk == $val1) 
                {
                    $flag = true;
                } 
                else if ($val2 != "" && $produk == $val2) 
                {
                    $flag = true;
                } 
            }
        }
    }
    
    return $flag;
}

?>
